package org.liveboardgames.agricola.model.enums
{
	import mx.utils.StringUtil;

	public class AbstractEnum
	{
		public static function composedWordToTitleCase(phrase:String):String
		{
			var result:String = "";
			
			var words:Array = phrase.split("_");
			for each (var word:String in words)
			{
				result = result + toTitleCase(word);
			}
			
			return result;
		}
		
		public static function toTitleCase(word:String):String
		{
			var firstLetter:String = word.substr(0, 1);
			firstLetter = firstLetter.toUpperCase();
			var otherLetters:String = word.substring(1).toLowerCase();
			var result:String = firstLetter + otherLetters;
			return result;
		}

	}
}